/*
 *  txdnet.cn tonydon
 * 
 */
package cn.txdnet.txcms.domain;

import cn.txdnet.txweb.annotation.validation.ClearEnterBlank;
import cn.txdnet.txweb.annotation.validation.CurrTime;
import cn.txdnet.txweb.annotation.validation.Default;
import cn.txdnet.txweb.annotation.validation.NotEmpty;
import cn.txdnet.txweb.annotation.validation.Size;
import cn.txdnet.txweb.annotation.validation.Validator;

/**
 *
 * @author txdnet
 */
public class Events extends BaseEntity{
    private static final long serialVersionUID = 7819968368394527788L;
    
    private Integer id;
    
    @Default
    private Integer cid;
    
    @Default("0")
    private String ctp;
    
    @Default
    private Byte channeltype;
    
    @NotEmpty
    @Size(min=1,max=60)
    private String eventname;
    
    @Default("-")
    private String pic;
    
    @CurrTime
    private Long pubtime;
    
    @Default(byteVal=0)
    private Byte pubstate;
    
    @Default(longVal=0)
    private Long endtime;
    
    @Default(byteVal=0)
    private Byte cmstype;
    
    @Default("-")
    private String gotourl;
    
    @Default("-")
    @ClearEnterBlank
    private String content;
    
    @Default("-")
    private String author;
    
    @Default(intVal=0)
    private Integer hitnum;

    @Override
    public boolean validate() {
       return Validator.validate(this);
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 37 * hash + (this.id != null ? this.id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final Events other = (Events) obj;
        if (this.id != other.id && (this.id == null || !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Events{" + "id=" + id + ", cid=" + cid + ", eventname=" + eventname + ", pic=" + pic + ", pubtime=" + pubtime + ", pubstate=" + pubstate + ", endtime=" + endtime + ", cmstype=" + cmstype + ", gotourl=" + gotourl + ", content=" + content + ", author=" + author + ", hitnum=" + hitnum + '}';
    }

    /**
     * @return the id
     */
    public Integer getId() {
        return id;
    }

    /**
     * @param id the id to set
     */
    public void setId(Integer id) {
        this.id = id;
    }

    /**
     * @return the cid
     */
    public Integer getCid() {
        return cid;
    }

    /**
     * @param cid the cid to set
     */
    public void setCid(Integer cid) {
        this.cid = cid;
    }

    /**
     * @return the eventname
     */
    public String getEventname() {
        return eventname;
    }

    /**
     * @param eventname the eventname to set
     */
    public void setEventname(String eventname) {
        this.eventname = eventname;
    }

    /**
     * @return the pic
     */
    public String getPic() {
        return pic;
    }

    /**
     * @param pic the pic to set
     */
    public void setPic(String pic) {
        this.pic = pic;
    }

    /**
     * @return the pubtime
     */
    public Long getPubtime() {
        return pubtime;
    }

    /**
     * @param pubtime the pubtime to set
     */
    public void setPubtime(Long pubtime) {
        this.pubtime = pubtime;
    }

    /**
     * @return the pubstate
     */
    public Byte getPubstate() {
        return pubstate;
    }

    /**
     * @param pubstate the pubstate to set
     */
    public void setPubstate(Byte pubstate) {
        this.pubstate = pubstate;
    }

    /**
     * @return the endtime
     */
    public Long getEndtime() {
        return endtime;
    }

    /**
     * @param endtime the endtime to set
     */
    public void setEndtime(Long endtime) {
        this.endtime = endtime;
    }

    /**
     * @return the cmstype
     */
    public Byte getCmstype() {
        return cmstype;
    }

    /**
     * @param cmstype the cmstype to set
     */
    public void setCmstype(Byte cmstype) {
        this.cmstype = cmstype;
    }

    /**
     * @return the gotourl
     */
    public String getGotourl() {
        return gotourl;
    }

    /**
     * @param gotourl the gotourl to set
     */
    public void setGotourl(String gotourl) {
        this.gotourl = gotourl;
    }

    /**
     * @return the content
     */
    public String getContent() {
        return content;
    }

    /**
     * @param content the content to set
     */
    public void setContent(String content) {
        this.content = content;
    }

    /**
     * @return the author
     */
    public String getAuthor() {
        return author;
    }

    /**
     * @param author the author to set
     */
    public void setAuthor(String author) {
        this.author = author;
    }

    /**
     * @return the hitnum
     */
    public Integer getHitnum() {
        return hitnum;
    }

    /**
     * @param hitnum the hitnum to set
     */
    public void setHitnum(Integer hitnum) {
        this.hitnum = hitnum;
    }

    /**
     * @return the channeltype
     */
    public Byte getChanneltype() {
        return channeltype;
    }

    /**
     * @param channeltype the channeltype to set
     */
    public void setChanneltype(Byte channeltype) {
        this.channeltype = channeltype;
    }

    /**
     * @return the ctp
     */
    public String getCtp() {
        return ctp;
    }

    /**
     * @param ctp the ctp to set
     */
    public void setCtp(String ctp) {
        this.ctp = ctp;
    }
    
}
